<template>
  <div>
    <ul>
      <li v-for="(item,index) in arr " :key="index" v-html="item">
      </li>
      <button @click="reverse">翻转</button>
      <button @click="btn">截取前两个</button>
      <button @click="upBtn">改变第三个</button>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [5, 3, 9, 2, 1],
    };
  },
  methods: {
    reverse(){
      this.arr.reverse()
    },
    btn(){
      this.arr=this.arr.slice(0,2)
    },
    upBtn(){
    this.$set(this.arr,2,100)
     //this.arr[2]=100
    }

  }
};
</script>

<style>
</style>